/**
 * Created by henian.xu on 2019/10/22.
 * 所有插件入口
 */
import './filter';
import './directives';
// import './weixin';
import Meta from 'vue-meta';
import Moment from 'dayjs';
import duration from 'dayjs/plugin/duration';
import utc from 'dayjs/plugin/utc';
import DefaultImg from 'assets/images/default.jpg';
import DefaultAvatar from 'assets/images/defaultAvatar.png';
import loadingIcon from 'assets/images/loading.gif';
import router from 'router';
import store from 'store';
import * as Utils from 'utils';
import ApiInstall from 'api';
import Nprogress from './hookNprogress';
import JweixinInstall from './jweixin';
import navigation from './navigation';
// import installSwiper from './installSwiper';

Moment.extend(duration);
Moment.extend(utc);

export default (Vue) => {
  window.$bus = new Vue();
  Vue.prototype.$bus = window.$bus;
  Vue.prototype.$moment = Moment;
  Vue.prototype.$defaultImg = DefaultImg;
  Vue.prototype.$defaultAvatar = DefaultAvatar;
  Vue.prototype.$loadingIcon = loadingIcon;
  Vue.prototype.$utils = Utils;
  Vue.prototype.$nprogress = Nprogress;

  Vue.use(Meta, {
    keyName: 'head', // the component option name that vue-meta looks for meta info on.
    // attribute: 'data-vue-meta', // the attribute name vue-meta adds to the tags it observes
    // ssrAttribute: 'data-vue-meta-server-rendered', // the attribute name that lets vue-meta know that meta info has already been server-rendered
    // tagIDKeyName: 'vmid', // the property name that vue-meta uses to determine whether to overwrite or append a tag
  });
  Vue.use(navigation, { router, store });
  Vue.use(ApiInstall);
  Vue.use(JweixinInstall);
  // Vue.use(installSwiper);
};
